import java.util.Scanner;

public class GameTest {
    public static void main(String[] args) {
        //随机产生1个[0,100)之间的整数，从键盘输入你要猜的数字，猜对位置
        int num = (int)(Math.random()*100);

        Scanner input = new Scanner(System.in);

        while (true) {
            System.out.print("请输入你猜的数字：");
            int guess = input.nextInt();

            if(num == guess){
                System.out.println("猜对了");
                break;
            }else if(guess > num){
                System.out.println("猜大了");
            }else{
                System.out.println("猜小了");
            }
        }

        input.close();
    }
}
